import cfg

import os
import time

if __name__=="__main__":
	root = cfg.root_dir
	name = time.strftime("%Y%m%d_%H%M")
	os.chdir(root)

	os.system(r"mkdir pkg\%s\src\cgi" % name)
	os.system(r"mkdir pkg\%s\cal" % name)
	os.system(r"mkdir pkg\%s\job\common" % name)
	os.system(r"mkdir pkg\%s\job\template" % name)
	os.system(r"mkdir pkg\%s\pkg" % name)
	os.system(r"mkdir pkg\%s\cfg\pkg\mail" % name)

	os.system(r"copy src\*.py pkg\%s\src " % name)
	os.system(r"copy src\cgi\*.py pkg\%s\src\cgi " % name)
	os.system(r"copy cal pkg\%s\cal " % name)
	os.system(r"copy job pkg\%s\job " % name)
	os.system(r"copy job\common pkg\%s\job\common " % name)
	os.system(r"copy job\template pkg\%s\job\template " % name)
	os.system(r"copy cfg pkg\%s\cfg\pkg " % name)
	os.system(r"copy cfg\mail pkg\%s\cfg\pkg\mail " % name)
	open(os.path.join(root,'pkg',name,'pkg',name+'.ok'),'w')
